﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using Adalbertus.BudgetPlanner.Domain;

namespace Adalbertus.BudgetPlanner.Services.Dto
{
    public class ExternalSourceDto : IDto
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public bool IsUnlimited { get; set; }

        private IList<ExternalSourceItemDto> _items;
        public IList<ExternalSourceItemDto> Items
        {
            get
            {
                Contract.Ensures(Contract.Result<IList<ExternalSourceItemDto>>() != null);
                return _items;
            }
            set
            {
                Contract.Requires<ArgumentNullException>(value != null);
                _items = value;
            }
        }

        public ExternalSourceDto()
        {
            _items = new List<ExternalSourceItemDto>();
        }
    }
}
